package net.csdn.business.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @ClassName BusinessTypeEnums
 * @Description TODO
 * @Author liuzhisheng
 * @Date 2023/9/18
 **/
@Getter
@AllArgsConstructor
public enum BusinessTypeEnums {
    ISSUE(1,"issue"),
    MR(2,"mr");

    final Integer code;
    final String type;

    public static BusinessTypeEnums ofCode(Integer code) {
        for (BusinessTypeEnums type : BusinessTypeEnums.values()) {
            if (type.code.equals(code)) {
                return type;
            }
        }
        throw new IllegalArgumentException("BusinessTypeEnums param error");
    }
}
